﻿using System;

namespace EmbeddedSharp.Core.Function.Flow {
    public class ThrowNode : FuncNode {

        public ThrowNode()
            : base() {
            base.Value = "throw";
        }

        public override FuncNode GetReversedFunction(int index) {
            throw new NotImplementedException();
        }

        public override object Evaluate() {
            object value = Parameters[0].Evaluate();

            throw new FunctionalCLRException(value);
        }
    }
}
